package cn.com.connext.scrm.repository.master;


import cn.com.connext.scrm.domain.master.ScanCodeRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface ScanCodeRecordRepository extends JpaRepository<ScanCodeRecord, Integer>, JpaSpecificationExecutor {
    @Query(value = "select * FROM scan_code_record where union_id= :unionId ",nativeQuery = true)
    List<ScanCodeRecord> findByUnionId(@Param("unionId") String unionId);
    @Query(value = "select * FROM scan_code_record where is_register = 1 ",nativeQuery = true)
    List<ScanCodeRecord> findAllIsRegister();
}
